package cpp.ece480.compteam;

import android.app.Activity;
import android.content.Intent;
import android.os.Bundle;
import android.view.View;
import android.widget.CheckBox;

public class MainActivity extends Activity {

	/** Called when the activity is first created. */
	@Override
	public void onCreate(Bundle savedInstanceState) {
		super.onCreate(savedInstanceState);
		setContentView(R.layout.main);			
	}
	
	protected void onPause() {
		super.onPause();
	}

	protected void onResume() {
		super.onResume();
	}

	protected void onDestroy() {
		super.onDestroy();
	}
	
	public void onCheckboxClicked1(View v) {
	    if (((CheckBox) v).isChecked()) {
	     	((GlobalVariable) this.getApplication()).setTable1(true);
	    } else {
	    	((GlobalVariable) this.getApplication()).setTable1(false);
	    }
	}
	
	public void onCheckboxClicked2(View v) {
	    if (((CheckBox) v).isChecked()) {
	    	((GlobalVariable) this.getApplication()).setTable2(true);
	    } else {
	    	((GlobalVariable) this.getApplication()).setTable2(false);
	    }
	}

	public void onCheckboxClicked3(View v) {
	    if (((CheckBox) v).isChecked()) {
	    	((GlobalVariable) this.getApplication()).setTable3(true);
	    } else {
	    	((GlobalVariable) this.getApplication()).setTable3(false);
	    }
	}
	
	public void onCheckboxClicked4(View v) {
	    if (((CheckBox) v).isChecked()) {
	    	((GlobalVariable) this.getApplication()).setTable4(true);
	    } else {
	    	((GlobalVariable) this.getApplication()).setTable4(false);
	    }
	}
	
	public void onCheckboxClicked5(View v) {
	    if (((CheckBox) v).isChecked()) {
	    	((GlobalVariable) this.getApplication()).setTable5(true);
	    } else {
	    	((GlobalVariable) this.getApplication()).setTable5(false);
	    }
	}

	public void onCheckboxClicked6(View v) {
	    if (((CheckBox) v).isChecked()) {
	    	((GlobalVariable) this.getApplication()).setTable6(true);
	    } else {
	    	((GlobalVariable) this.getApplication()).setTable6(false);
	    }
	}

	public void launchTableScreen(View v) {
		Intent intent = new Intent(this, TableScreen.class);
		startActivity(intent);
	}

	public void launchCheckoutScreen(View v) {
		Intent intent = new Intent(this, Checkout.class);
		startActivity(intent);
	}
}